
package com.joysuch.wwyt.datadump.biz.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.zlg.common.datadump.annotation.DataDumpEntity;
import cn.zlg.common.datadump.annotation.DataDumpField;
import com.joysuch.wwyt.bp.entity.inspect.dsl.QBPInspectItem;
import com.joysuch.wwyt.bp.entity.inspect.dsl.QBPInspectItemType;
import com.joysuch.wwyt.datadump.biz.convertor.IntegerToStringConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.StringToIntegerConvertor;
import com.joysuch.wwyt.datadump.biz.query.BpInspectItemDumpQueryBean;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 巡检内容
 * 
 * @since
 *
 */
@DataDumpEntity(name = "bp-inspect-item-dump", entity = QBPInspectItem.class, exportQueryConditions = BpInspectItemDumpQueryBean.class, businessName = "巡检内容")
@Data
public class BpInspectItemDumpBean {

    @NotNull(message = "序号必填，且必须为整数")
    @Pattern(regexp = "\\d+", message = "必须输入正整数")
    @Excel(name = "序号", width = 10)
    @DataDumpField(field = "seqNo", importKey = true, importConvertors = StringToIntegerConvertor.class, exportConvertors = IntegerToStringConvertor.class)
    private String seqNo;

    @NotNull
    @Length(max = 64)
    @Excel(name = "检查项目类型", width = 20)
    @DataDumpField(field = "inspectType", referenceEntity = QBPInspectItemType.class, referenceEntityField = "itemType", createRefEntityWhenNotExists = true)
    private String inspectTypeName;

    @NotNull
    @Length(max = 64)
    @Excel(name = "检查项目", width = 20)
    @DataDumpField(field = "inspectItem")
    private String inspectItem;

    @NotNull
    @Length(max = 512)
    @Excel(name = "检查标准", width = 30)
    @DataDumpField(field = "inspectStandard")
    private String standard;

}
